:art: Check is heandled or not

huangqimin001 2 ans auparavant
Parent
Commettre
7f77748d1d
2 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 3 0
      api/member_views.py
  2. 2 1
      utils/error/errno_utils.py

+ 3 - 0
api/member_views.py

@@ -746,6 +746,9 @@ def activity_contribute_welfare_unlocking_handled(request):
746 746
     except MemberActivityContributionWelfareUnlockingInfo.DoesNotExist:
747 747
         return response(MemberActivityContributionWelfareUnblockingStatusCode.ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_NOT_FOUND)
748 748
 
749
+    if unlocking.is_handled:
750
+        return response(MemberActivityContributionWelfareUnblockingStatusCode.ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_HAS_HANDLED)
751
+
749 752
     if user_id != unlocking.user_id:
750 753
         return response(PermissionStatusCode.PERMISSION_DENIED)
751 754
 

+ 2 - 1
utils/error/errno_utils.py

@@ -179,7 +179,8 @@ class MemberActivityContributionWelfareStatusCode(BaseStatusCode):
179 179
 
180 180
 class MemberActivityContributionWelfareUnblockingStatusCode(BaseStatusCode):
181 181
     """ 会员活动投稿福利相关错误码 5039xx """
182
-    ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_NOT_FOUND = StatusCodeField(503999, 'Activity Contribution Welfare Unblocking Not Found', description=u'活动投稿福利解锁不存在')
182
+    ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_NOT_FOUND = StatusCodeField(503901, 'Activity Contribution Welfare Unblocking Not Found', description=u'活动投稿福利解锁不存在')
183
+    ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_HAS_HANDLED = StatusCodeField(503902, 'Activity Contribution Welfare Unblocking Has Handled', description=u'活动投稿福利解锁已处理')
183 184
 
184 185
 
185 186
 class MemberCouponStatusCode(BaseStatusCode):